import * as request from '@/utils/request';
import Request from '@/common/utils/request';

export function getTeamList(data) {
  return request.get('/system/team/list', data);
}

export function addTeam(data = {}) {
  return request.post('/system/team', data);
}

export function editTeam(data = {}) {
  return request.put('/system/team', data);
}

export function delTeam(userId) {
  return request.del(`/system/team/${userId}`, {});
}

export function getTeamUserList(data) {
  return request.get('/system/user/team/list', data);
}

export function addTeamUser(data) {
  return request.post('/system/user/team', data);
}

export function removeTeamUser(ids) {
  return request.del(`/system/user/team/${ids}`, {});
}

export function setLeader(data = {}) {
  return request.put('/system/user/team/leader', data);
}
/**
 * 获取小组缓存
 */
const getCachedList = () => Request.get('/system/team/cache');
export default {
  getCachedList,
};
